{extend name='table'}

{block name="button"}
<!--{if auth("remove")}-->
<button data-table-id="OplogTable" data-modal='{:url("add")}'
  class='layui-btn layui-btn-sm layui-btn-primary'>{:lang('添加')}</button>
<!--{/if}-->


{block name="content"}
<div class="think-box-shadow">
  <table id="OplogTable" data-url="{:request()->url()}" data-target-search="form.form-search"></table>
</div>
{/block}

{block name='script'}
<script>
  $(function () {
    $('#OplogTable').layTable({
      even: true, height: 'full',
      sort: { field: 'id', type: 'desc' },
      cols: [[
        { field: 'create_date', width: 150, title: '操作时间' },
        {
          field: 'type', title: '属性', minWidth: 120, align: 'center', templet: function (d) {
            if (d.type == 1) return '<span class="layui-badge  layui-bg-green">入库</span>';
            else return '<span class="layui-badge  layui-bg-blue">出库</span>';
          }
        },
        { field: 'box_num', width: 120, title: '件数', align: 'center' },
        { field: 'num', width: 120, title: '数量(kg)', align: 'center' },
        { field: 'operator', width: 120, title: '操作人', align: 'center' },
        { field: 'note', width: 120, title: '备注', align: 'center' },
        { title: '操作', align: 'center', toolbar: '#toolbar' }
      ]]
    });
  });
</script>

<script type="text/html" id="toolbar">
 

<!--{if auth("removeLogs")}-->
<a class="layui-btn layui-btn-sm layui-btn-danger" data-confirm="{:lang('确定要永久删除吗？')}" data-action='{:url("removeLogs")}?id={{d.id}}'
  data-value="id#{{d.id}}">{:lang('删 除')}</a>
<!--{/if}-->

</script>
{/block}